package pojo;

import org.junit.Test;

import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * @author gzkemays
 * @date 2021/3/5 11:07
 */
public class LambdaFunc {
    public static final boolean tag = false;

    public <V> void getSender(Consumer<V> consumer, V o) {
        if (tag) {
            consumer.accept(o);
        }
    }

    public <V> void getSender(A supplier) {
            supplier.a();
    }

    private void print2(String text) {
        System.out.println(text+"print");
    }

    @Test
    public void Test(){
        getSender(() -> {
            System.out.println("args =123 ");
        });
        getSender((args) -> {
            System.out.println("args = " + args);
        },"123");
    }
}
